import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getx_learn/app/common/widgets/widgets.dart';
import 'package:getx_learn/app/routes/app_pages.dart';

import '../controllers/getx_controller_demo_controller.dart';

class GetxControllerDemoView extends GetView<GetxControllerDemoController> {
  const GetxControllerDemoView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: getAppBar(context: context, title: "GetxControllerDemoView"),
      body: ListView(
        children: [
          ListTile(
            title: Text("GetxController生命周期"),
            subtitle: Text("这种生命周期监听是页面切换那些"),
            onTap: () {
              Get.toNamed(Routes.GETX_CONTROLLER_PAGE);
            },
          ),
          Divider(),
          ListTile(
            title: Text("SuperController生命周期"),
            subtitle: Text("是对GetxController生命周期的增强，可以监听类似Activity的生命周期"),
            onTap: () {
              Get.toNamed(Routes.SUPER_CONTROLLER_PAGE);
            },
          ),
          Divider(),
          ListTile(
            title: Text("GetConnect"),
            subtitle: Text("进行api请求的类"),
            onTap: () {
              Get.toNamed(Routes.GETCONNECT_PAGE);
            },
          ),
          Divider(),

          ListTile(
            title: Text("StateMixin"),
            subtitle: Text("进行api请求的类"),
            onTap: () {
              Get.toNamed(Routes.STATEMIXIN_PAGE);
            },
          ),
          Divider(),


        ],
      ),
    );
  }
}
